-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
program: dynamic liquidation fee for liq_perp_with_fill #1185
Conversation
pub struct SetUserStatusToBeingLiquidated<'info> { | ||
pub state: Box<Account<'info, State>>, | ||
#[account(mut)] | ||
pub user: AccountLoader<'info, User>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to add a signer here as well, i think anchor client is probably just adding it by default on the client side
@@ -969,13 +967,28 @@ pub fn liquidate_perp_with_fill( | |||
)?; | |||
|
|||
let existing_direction = user.perp_positions[position_index].get_direction(); | |||
let max_liquidation_fee = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- should use safe_math
- should prob just call get_ref once and then drop it
could potentially also just make this a method on the perp market account?
No description provided.